//
//  DCButtonAndLabel.m
//  JiuyaoDriver
//
//  Created by 大橙子 on 2018/11/10.
//  Copyright © 2018 Tomous. All rights reserved.
//

#import "DCButtonAndLabel.h"

@implementation DCButtonAndLabel
-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self setUpUI];
    }
    return self;
}
-(void)setUpUI {
    self.chooseBtn = [UIButton buttonWithType:UIButtonTypeCustom];
//    self.chooseBtn.backgroundColor = [UIColor redColor];
    [self addSubview:self.chooseBtn];
    
    self.textLabel = [[UILabel alloc]init];
//    self.textLabel.backgroundColor = [UIColor cyanColor];
    [self addSubview:self.textLabel];
}
- (void)layoutSubviews {
    [super layoutSubviews];
    self.chooseBtn.frame = CGRectMake(0, (self.height - 20)/2, 20, 20);
    self.textLabel.frame = CGRectMake(self.chooseBtn.right+3, 0, self.width - self.chooseBtn.width-3, self.height);
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
